//
//  BTEMeListTableViewCell.swift
//  BTE
//
//  Created by Mike Zhang on 2025/8/21.
//

import UIKit
import SDWebImage

class BTEMeListTableViewCell: UITableViewCell {
    
    var model: BTEvincentsModel? {
        didSet {
            guard let m = model else {
                return
            }
            
            a1.sd_setImage(with: URL.init(string: m.opinator!))
            t1.text = m.aftermath
        }
    }

    let cv = UIImageView.init(image: UIImage.init(named: "Groupfwefw333331171276686"))
    
    let a1 = UIImageView()
    
    let t1 = UILabel.init()
    
    let ri = UIImageView(image: UIImage.init(named: "Vector"))
  
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
        selectionStyle = .none
        
        backgroundColor = .clear
        contentView.backgroundColor = .clear
        
        contentView.addSubview(cv)
        cv.snp.makeConstraints { make in
            make.top.bottom.equalToSuperview().inset(5)
            make.left.right.equalToSuperview().inset(17)
        }
        
        cv.addSubview(ri)
        ri.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.right.equalToSuperview().offset(-23)
        }
        
        cv.addSubview(a1)
        a1.snp.makeConstraints { make in
            make.left.equalToSuperview().offset(17)
            make.centerY.equalToSuperview()
            make.width.height.equalTo(34)
        }
        
        t1.textColor = .black
        t1.font = .systemFont(ofSize: 16, weight: .bold)
        cv.addSubview(t1)
        t1.snp.makeConstraints { make in
            make.centerY.equalToSuperview()
            make.left.equalTo(a1.snp.right).offset(10)
        }
    }
    
    
    
}
